package com.example.sentence.service;

import com.example.sentence.dao.SentenDao;
import com.example.sentence.entity.Senten;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 句子service实现
 * @author Administrator
 */
@Service
public class SentenceServiceImpl implements SentenceService{
    @Resource
    private SentenDao sentenDao;

    @Override
    public List<Senten> findAll() {
        return sentenDao.findAll();
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void save(Senten senten){
        sentenDao.insert(senten);
    }
}
